import type { RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    name: "login",
    path: "/login",
    component: () => import("@/pages/login/index.vue"),
  },
  {
    name: "register",
    path: "/register",
    component: () =>
      import("@/pages/home/registerLogin/accountRegister/index.vue"),
  },
  {
    name: "noAuth",
    path: "/noAuth",
    component: () =>
      import("@/pages/home/registerLogin/accountRegister/noAuth.vue"),
  },
  {
    name: "authCompany",
    path: "/authCompany",
    component: () =>
      import("@/pages/home/registerLogin/accountRegister/authResource.vue"),
  },
  {
    name: "authing",
    path: "/authing",
    component: () =>
      import("@/pages/home/registerLogin/accountRegister/authing.vue"),
  },
  {
    name: "authingResult",
    path: "/authingResult",
    component: () =>
      import("@/pages/home/registerLogin/accountRegister/authingResult.vue"),
  },
  {
    name: "forgetPassword",
    path: "/forgetPassword",
    component: () =>
      import("@/pages/home/registerLogin/forgetPassword/index.vue"),
  },
  {
    name: "resetSuccess",
    path: "/resetSuccess",
    component: () =>
      import("@/pages/home/registerLogin/forgetPassword/resetSuccess.vue"),
  },
  {
    name: "home",
    path: "/home",
    component: () => import("@/pages/home/index.vue"),
    redirect: "/home/account",
    children: [
      {
        name: "product",
        path: "product",
        component: () => import("@/pages/home/product/index.vue"),
        redirect: "/home/product/category",
        meta: {
          title: "产品开发",
          icon: "product",
        },
        children: [
          {
            name: "category",
            path: "category",
            component: () => import("@/pages/home/product/develop/index.vue"),
            meta: {
              title: "产品开发",
              icon: "category",
            },
          },
          {
            name: "details",
            path: "details",
            component: () => import("@/pages/home/product/develop/addProductDetails.vue"),
            meta: {
              title: "产品开发",
              icon: "category",
              isHideMenu: true
            },
          },
          //   {
          //     name: "profile",
          //     path: "profile",
          //     component: () => import("@/pages/home/product/profile/index.vue"),
          //     meta: {
          //       title: "Profile管理",
          //       icon: "profile",
          //     },
          //   },
        ],
      },
      {
        name: "resource",
        path: "resource",
        component: () => import("@/pages/home/resource/index.vue"),
        redirect: "/home/resource/deviceLibrary",
        meta: {
          title: "量产管理",
          icon: "resource",
        },
        children: [
          {
            name: "deviceLibrary",
            path: "deviceLibrary",
            // component: () =>
            //   import("@/pages/home/resource/deviceLibrary/index.vue"),
            component: () => import("@/pages/home/views/Developing.vue"),
            meta: {
              title: "设备授权",
              icon: "device",
            },
          },
          //   {
          //     name: "sceneLibrary",
          //     path: "sceneLibrary",
          //     component: () =>
          //       import("@/pages/home/resource/sceneLibrary/index.vue"),
          //     meta: {
          //       title: "场景库管理",
          //       icon: "scene",
          //     },
          //   },
        ],
      },
      {
        name: "account",
        path: "account",
        component: () => import("@/pages/home/account/index.vue"),
        redirect: "/home/account/authResource",
        meta: {
          title: "账号管理",
          icon: "account",
        },
        children: [
          {
            name: "user",
            path: "user",
            // component: () => import("@/pages/home/account/user/index.vue"),
            component: () => import("@/pages/home/views/Developing.vue"),
            meta: {
              title: "基本资料",
              icon: "user",
            },
          },
          {
            name: "authResource",
            path: "authResource",
            component: () =>
              import("@/pages/home/account/authResource/index.vue"),
            meta: {
              title: "认证资料",
              icon: "role",
            },
          },
          //   {
          //     name: "user",
          //     path: "user",
          //     component: () => import("@/pages/home/account/user/index.vue"),
          //     meta: {
          //       title: "用户管理",
          //       icon: "user",
          //     },
          //   },
          //   {
          //     name: "role",
          //     path: "role",
          //     component: () => import("@/pages/home/account/role/index.vue"),
          //     meta: {
          //       title: "角色管理",
          //       icon: "role",
          //     },
          //   },
          //   {
          //     name: "permission",
          //     path: "permission",
          //     component: () =>
          //       import("@/pages/home/account/permission/index.vue"),
          //     meta: {
          //       title: "权限管理",
          //       icon: "permission",
          //     },
          //   },
          //   {
          //     name: "enterprise",
          //     path: "enterprise",
          //     component: () =>
          //       import("@/pages/home/account/enterprise/index.vue"),
          //     meta: {
          //       title: "企业管理",
          //       icon: "enterprise",
          //     },
          //   },
        ],
      },
    ],
  },
];

export default routes;
